package org.ljdp.bootstrap.loader;

import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;

import org.ljdp.bootstrap.LoaderUtil;

public class WebappLoader {
	private String currPath;
	private String deployName;

	public WebappLoader(String currPath, String deployName) {
		super();
		this.currPath = currPath;
		this.deployName = deployName;
	}
	
	public void doLoadClass() throws MalformedURLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
		int lastIndex = currPath.lastIndexOf(File.separator);
		String procPath = currPath.substring(0, lastIndex);
		List<URL> urls = LoaderUtil.buildWebModelURL(procPath, deployName);
		LoaderUtil.addClasses(urls);
	}
}
